package group.program.register.email;

import group.program.Controller.RegisterController;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.MockitoAnnotations;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;

class format {
    @InjectMocks
    private RegisterController registerController;

    @BeforeEach
    void setUp() {
        MockitoAnnotations.openMocks(this);
    }

    @Test
    void testValidateEmailFormat() {
        String validEmail = "test@test.com";
        assertNull(registerController.validateEmailFormat(validEmail));
    }

    @Test
    void testInvalidEmailFormat() {
        String invalidEmail = "test@test";
        assertEquals("邮件地址格式不正确", registerController.validateEmailFormat(invalidEmail));
    }
}
